{include file="public/layout" /}
<body class="laytp-container">
<div class="layui-card" id="search-form">
    <div class="layui-card-body">
        <form class="layui-form" action="">
    <div class="layui-form-item">
        <label class="layui-form-label">基本信息</label>
        <div class="layui-input-inline layui-input-wrap" style="width: 80%;">
            <table class="layui-table" >
                <tr>
                    <td>订单 ID：</td>
                    <td>{$order.order_id}</td>
                    <td>订单号：</td>
                    <td>{$order.order_sn}</td>
                    <td>会员：</td>
                    <td>{$user.nickname} ID:{$order.user_id}</td>
                </tr>
                <tr>
                    <td>电话：</td>
                    <td colspan="2">{$order.mobile}</td>
                    <td>订单状态：</td>
                    <td colspan="2">{$order_status[$order['order_status']]}</td>
                </tr>
                <tr>
                    <td>下单时间：</td>
                    <td>{$order.add_time|date='Y-m-d H:i'}</td>
                    <td>支付时间：</td>
                    <td>
                        {$order.pay_time|date='Y-m-d H:i'}
                    </td>
                    <td>发货时间：</td>
                    <td>
                        {$order.shipping_time|date='Y-m-d H:i'|default='无'}
                    </td>
                </tr>
                <tr>
                    <td>收货时间：</td>
                    <td> {$order.confirm_time|date='Y-m-d H:i'}</td>
                    <td>退货申请时间：</td>
                    <td> {$order.tuihuo_sqtime|date='Y-m-d H:i'}</td>
                    <td>退货原因：</td>
                    <td> {$order.tuihuo_reason}</td>
                </tr>
            </table>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">收货信息</label>
        <div class="layui-input-inline layui-input-wrap" style="width: 80%;">
            <table class="layui-table">
                <tr>
                    <td>收货人：</td>
                    <td>{$order.consignee}</td>
                    <td>联系方式：</td>
                    <td>{$order.mobile}</td>
                </tr>
                <tr>
                    <td>收货地址：</td>
                    <td>{$order.full_address}</td>
                    <td>买家留言：</td>
                    <td>{$order.user_note|default=''}</td>
                </tr>
                <tr>
                    <td>配送方式：</td>
                    <td>{$order.shipping_name}--{$order['delivery_no']}</td>
                    <td>发货备注：</td>
                    <td>{$order.admin_note}</td>
                </tr>
            </table>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">商品信息</label>
        <div class="layui-input-inline layui-input-wrap" style="width: 80%;">
            <table class="layui-table">
            <thead>
            <tr>
                <th>商品ID</th>
                <th>商品名称</th>
                <th>规格属性</th>
                <th>数量</th>
                <th>原价</th>
                <th>销售价</th>
                <th>单品小计</th>
            </tr>
            </thead>
            <tbody>
            {foreach $order['orderGoods']  as $good}
            <tr>
                <td class="w30">{$good['goods_id']}</td>
                <td style="text-align: left;"><a href="{:url('Mobile/Goods/goodsInfo',array('id'=>$good['goods_id']))}" target="_blank">{$good.goods_name}</a><br/></td>
                <td class="w80">{$good.spec_key_name}</td>
                <td class="w60">{$good.goods_num}</td>
                <td class="w100">{$good.market_price}</td>
                <td class="w100">{$good.shop_price}</td>
                <td class="w80">{:bcmul($good['shop_price'],$good['goods_num'],2)}</td>
            </tr>
            {/foreach}
        </table>
        </div>
    </div>
        {if $order['order_status']> 1 && $order['invoice_no']}
    <div class="layui-form-item">
        <label class="layui-form-label">物流信息</label>
        <div class="layui-input-inline layui-input-wrap" style="width: 80%;">
            <table class="layui-table">
                <thead>
                <tr>
                    <th>操作时间</th>
                    <th>状态</th>
                </tr>
                </thead>
                <tbody>

            </table>
        </div>
            <script>
                $(function(){
                    var shipping_code = "{$order['shipping_code']}";
                    var invoice_no = "{$order['invoice_no']}";
                    $.ajax({
                        type : "GET",
                        dataType: "json",
                        url:"/index.php?m=Mobile&c=Api&a=queryExpress&shipping_code="+shipping_code+"&invoice_no="+invoice_no,//+tab,
                        success: function(data){
                            var html = '';
                            if(data.status == 200){
                                $.each(data.data, function(i,n){
                                    if(i == 0){
                                        html += '<tr><td class="text-center">'+n.time+'</td><td class="text-center">'+n.context+'</td></tr>'
                                    }else{
                                        html += '<tr><td class="text-center">'+n.time+'</td><td class="text-center">'+n.context+'</td></tr>'
                                    }
                                });
                            }else{
                                html += "<tr><td class='text-center'>"+data.message+"</td></tr>"
                            }
                            $("#express_info").append(html);
                        }
                    });
                })
            </script>
    </div>
        {/if}
    <div class="layui-form-item">
        <label class="layui-form-label">费用信息</label>
        <div class="layui-input-inline layui-input-wrap" style="width: 80%;">
            <table class="layui-table">
                <tr>
                    <td>小计：</td>
                    <td>运费：</td>
                    <td>支付信息：</td>
                </tr>
                <tr>
                    <td>{$order.total_shop_price}</td>
                    <td>+{$order.shipping_price}</td>
                    <td><?php $payment = unserialize($order['payment']); ?>
                        {foreach $payment as  $key=>$pay}
                        {if $pay>0}
                        使用{$wallet[$key]}：{$pay}
                        {/if}
                        {/foreach}
                    </td>
                </tr>
            </table>
        </div>
    </div>
    {if $order.order_status==1 && $order['is_th'] ==1}
    <div class="layui-form-item">
        <div class="layui-input-block">
            <a class="layui-btn" href="{:url('Order/delivery_info',array('order_id'=>$order['order_id']))}">去发货</a>
        </div>
    </div>
    {/if}
</form>
    </div>
</div>
</body>
</html>